<template>
  <div class="dyp">
    <Head></Head>

    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="个性推荐" name="first">
        <img src="../assets/392.png" alt="" style="width:100%;" class="img" />
        <div class="qian">
          <ul class="feng">
            <li>
              <i class="iconfont icon-remai bbb"></i>
              今日热门
            </li>
            <li><i>·</i> 互联网是怎么跟广告业抢饭吃的</li>
            <li><i>·</i> 中国哪个姓氏最厉害</li>
          </ul>
        </div>
        <div class="gaga"></div>
        <div class="ios">
          <ul class="vr">
            <li v-for="(item, i) in mk" :key="i">
              <router-link :to="{ path: '/About', query: { id: item.id } }">
                <h4>
                  <p class="max">{{ item.title }}</p>
                  <p class="min">{{ item.tit }}</p>
                </h4>
                <b
                  ><img
                    :src="require(`../assets/${item.img}`)"
                    alt=""
                    style="width:100px;height:100px;"
                /></b>
              </router-link>
            </li>
          </ul>
        </div>
      </el-tab-pane>
      <el-tab-pane label="课程" name="second">
            <swiper></swiper>
        <div class="jingxuan"><h3>精选好课</h3></div>
          <div class="ui">
            <ul class="html">
              <li v-for="(item,i) in jj" :key="i.id">
              <router-link :to="{ path: '/xiang', query: { id: item.id } }">  <img :src="require(`../assets/${item.img}`)" alt="" style="width:170px;height:100px;">
                <p>{{item.title}}</p>
                <h6>{{item.money}}</h6></router-link>
              </li>
            </ul>
          </div>

      </el-tab-pane>
      <el-tab-pane label="微专业" name="third">
      
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import Head from "@/components/Head";
import { getlist,getbanner} from "@/api";
import swiper from "@/components/swiper"
import axios from "axios";
export default {
  components: {
    Head,
    swiper
  },
  data() {
    return {
      activeName: "first",
      mk: [],
      dyp:[],
      jj:[]
    };
  },
  mounted() {
    getlist().then((res) => {
      this.mk = res.data;
    }),
    getbanner().then(res=>{
      console.log(res,"sdsd")
        this.jj =res.data
    })
     
  },
  methods: {
    handleClick(tab, event) {

    },
   
  },
  
};
</script>

<style>
.ui{
  width: 100%;
  margin-top: 10px;
  /* display: flex; */
  /* flex-wrap: wrap; */
}
.html{
  width: 97%;
  margin: 0 auto;
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  font-size: 10px;
  /* flex-direction: column; */
}
.html li{
  width: 48%;
  height: 170px;
  margin-left: 5px;
  position: relative;
}
.html p{
  margin-top: 10px;
}
.html h6{
  color: red;
  position: absolute;
  bottom: 10px;
  left: 0;
}
.jingxuan{
  width: 100%;
  margin-top: 10px;
}
.jingxuan h3{
  width: 95%;
  margin: 0 auto;
}
a {
  color: #000;
  text-decoration: none;
}
.bbb {
  color: red;
}
.max {
  margin-top: 10px;
}
.min {
  color: #686262;
  font-size: 10px;
  margin-top: 10px;
}
.ios {
  width: 100%;
}
.vr li {
  width: 97%;
  margin: 0 auto;
  background: #fff;
  /* margin-top: 10px; */
  overflow: hidden;
  border-bottom: 1px solid rgb(102, 101, 101);
}
.vr h4 {
  float: left;
  width: 70%;
}
.vr b {
  float: left;
  width: 20%;
  margin-left: 5px;
}
.gaga {
  width: 100%;
  height: 10px;
  background: #f5f5f5;
}
.dyp .el-tabs__nav-scroll {
  margin-left: 40px;
}
.dyp .el-tabs__item {
  padding: 0 40px;
}
.dyp .el-tabs__nav-wrap::after {
  width: 0;
}
.dyp .el-tabs__item.is-active {
  color: rgb(51, 128, 7);
}
.dyp .el-tabs__active-bar {
  background-color: rgb(51, 128, 7);
}
.dyp .el-tabs__header {
  margin: 0 0 2px;
}
.dyp {
  padding-bottom: 56px;
}
img {
  border: 0;
  display: block;
}
.qian {
  width: 100%;
  overflow: hidden;
  background: #fff;
}
.feng {
  width: 95%;
  margin: 0 auto;
}
.feng i {
  font-size: 20px;
  font-weight: bold;
}
.feng li {
  margin-top: 17px;
}
</style>
